import React, { ComponentType, ComponentProps } from 'react';
import { Navigate } from 'react-router-dom'
const isLogin = (Com: ComponentType<any>) => {
    return (props: ComponentProps<any>) => {
        const token = window.localStorage.getItem('token')
        if (!token) {
            return <Navigate to="/login"></Navigate>
        }
        return <Com {...props}></Com>
    }
}
export default isLogin